Skip to content

Fix light-client worker reuse and init failure#88

Open
arentant wants to merge 1 commit intomain-v2from
arentant/revive-helios-client
Open

Fix light-client worker reuse and init failure#88
arentant wants to merge 1 commit intomain-v2from
arentant/revive-helios-client

Conversation

@arentant
Copy link
Contributor

Summary

Fix two critical light-client verification bugs: dead worker reuse on successive swaps, and init failure blocking the action panel forever.

Bug 1: EVMLightClient.getDetails() terminated workers without nulling the reference, so re-entry checks always found a dead worker and skipped re-initialization. Subsequent swaps on the same destination chain would hang in light-client verification and fall back to degraded single-RPC polling.

Bug 2: Init failures (e.g., worker bootstrap timeout) never recorded an error state, leaving lightClientPending true forever. The action panel returned empty (line 105 in Actions/index.tsx), leaving users unable to reveal secrets or access RPC-based fallbacks.

Changes

  • Null worker reference after each terminate() call in EVMLightClient (success, max-retries, error paths)
  • Set destinationDetailsByLightClient with error on init failure so lightClientPending becomes false and UI unblocks
  • Reset light-client instance when hashlock changes to force fresh initialization
  • Extract supportsLightClient check to a reusable utility function

🤖 Generated with Claude Code

Two critical bugs in light-client verification flow:

1. Dead worker reuse: EVMLightClient.getDetails() terminated the worker
on every exit but never nulled the reference, so !this.worker always
returned false on re-entry. A second swap on the same destination chain
would hang in light-client verification and fall back to degraded RPC path.

2. Init failure blocks action panel: On init failure, lightClientPending
stayed true forever, returning empty action panel and leaving user unable
to reveal secret or fall back to RPC verification.

Fixes: Null worker reference after terminate in all paths (success,
max-retries, error). Set destinationDetailsByLightClient with error on
init failure so lightClientPending becomes false and UI unblocks. Reset
light-client instance when hashlock changes to force fresh initialization.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
trainapp-monorepo Ready Ready Preview, Comment Mar 11, 2026 2:48pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant